import { getDetails } from '@/api/admin/user'

var validateUsername = (rule, value, callback) => {
  getDetails(value).then(response => {
    if (window.boxType === 'edit') callback()
    let result = response.data.data
    if (result !== null) {
      callback(new Error('用户名已经存在'))
    } else {
      callback()
    }
  })
}
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  editBtn: false,
  delBtn: false,
  align: 'center',
  addBtn: false,
  viewBtn:true,
  column: [
    {
    fixed: true,
    label: '设备Id',
    prop: 'originalDeviceId',
    span: 30,
    editDisabled: true,
    addVisdiplay: false
  },
    {
      label: '设备名称',
      prop: 'deviceName',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },{
    label: '设备类型',
    prop: 'deviceType',
    overHidden: true,
    addVisdiplay: false,
    editVisdiplay: false,
    span: 24,
  },
    {
      label: '设备品牌',
      prop: 'deviceBrand',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '设备型号',
      prop: 'deviceModel',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '机房名称',
      prop: 'roomName',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '地址',
      prop: 'address',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '部门',
      prop: 'department',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '管理员',
      prop: 'manager',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '连接状态',
      prop: 'connectState',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '告警统计',
      prop: 'alarmCount',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '制造商',
      prop: 'manufacturer',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '安装时间',
      prop: 'installationTime',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '供应商',
      prop: 'supplier',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '描述',
      prop: 'description',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '管理状态',
      prop: 'manageStatus',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    }

  ]
}
